
package ch.hearc.coursJava.moo.statics;



public class CompteUBS
	{

	/*------------------------------------------------------------------*\
	|*							Constructeurs							*|
	\*------------------------------------------------------------------*/

	public CompteUBS(double montant)
		{
		this.montant = montant;
		}



	/*------------------------------*\
	|*				Set				*|
	\*------------------------------*/

	public void setMontant(double montant)
		{
		this.montant = montant;
		}

	/*------------------------------*\
	|*				Get				*|
	\*------------------------------*/
	public double getMontant()
		{
		return this.montant;
		}

	@Override
	public String toString()
		{
		StringBuilder builder = new StringBuilder();
		builder.append("CompteUBS \n\tMontant=");
		builder.append(this.montant);
		builder.append("\n\tTaux=");
		builder.append(CompteUBS.taux);
		builder.append("\n\tmontant final = ");
		builder.append(this.getVraiMontant() + "\n");
		return builder.toString();
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Public							*|
	\*------------------------------------------------------------------*/

		public double calculerInteret()
			{
				return (this.montant*CompteUBS.taux);
			}

		public double getVraiMontant()
			{
				return this.calculerInteret() + this.montant;
			}




	/*------------------------------*\
	|*			  Static			*|
	\*------------------------------*/


	public static void setTaux(double taux)
		{
		CompteUBS.taux = taux;
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Private						*|
	\*------------------------------------------------------------------*/





	/*------------------------------------------------------------------*\
	|*							Attributs Private						*|
	\*------------------------------------------------------------------*/
	//Input
	private double montant;

/*------------------------------*\
|*			  Static			*|
\*------------------------------*/

	private static double taux;
	}
